Skip to content

Fix vote-count sidebar chart floating over the member list below 992px - #455

Open
JeffreyBLewis wants to merge 1 commit into
masterfrom
fix-sticky-vote-chart-overlap
Open

Fix vote-count sidebar chart floating over the member list below 992px#455
JeffreyBLewis wants to merge 1 commit into
masterfrom
fix-sticky-vote-chart-overlap

Conversation

@JeffreyBLewis

Copy link
Copy Markdown
Collaborator

Summary

$("#vote_chart_float").stick_in_parent() pins the rollcall page's party vote-count bar chart to the viewport while scrolling, so it stays visible next to the member vote list. That's correct at >=992px where the two Bootstrap columns sit side by side, but below that breakpoint the columns stack to full width -- so the "stuck" chart became a full-width bar fixed to the top of the viewport, floating directly over the member list as it scrolled underneath it.

Fix: gate the sticky behavior on $(window).width() >= 992 (matching the Bootstrap md breakpoint where the columns are actually side by side), and attach/detach on resize so a window resize mid-scroll doesn't leave it in a broken state either way.

Test plan

Verified with headless Chromium (Playwright), not just HTTP/syntax checks this time:

  • Scanned the full scroll height of a rollcall page at every 100px, checking the chart's bounding box against the vote list's, at 375/768/900px (previously overlapped) and 992/1280px (control) -- no overlap anywhere after the fix
  • Confirmed desktop sticky behavior at >=992px is byte-for-byte unchanged (still sticks/unsticks at the same scroll positions as before)
  • Resized the viewport across the 992px breakpoint mid-scroll in both directions -- correctly detaches below, correctly re-attaches and sticks again above
  • No console or page errors during any of the above
  • node --check on the changed file

🤖 Generated with Claude Code

https://claude.ai/code/session_013KJMYfgTNsxrmjHZpZKAHT

$("#vote_chart_float").stick_in_parent() pins the vote page's party
vote-count bar chart to the viewport as you scroll past it, so it stays
visible alongside the member vote list below. That's fine at >=992px
where the two columns sit side by side, but Bootstrap stacks them to
full width below that -- so the "stuck" chart became a full-width bar
fixed to the top of the viewport, floating directly over the member
list as it scrolled underneath.

Gate the sticky behavior on window width (>=992px, matching the
Bootstrap md breakpoint where the columns are actually side by side),
and detach/reattach it on resize so someone resizing the window mid-
scroll doesn't get stuck in a broken state either way.

Verified with headless Chromium (Playwright) at 375/768/900/992/1280px,
scrolling the full height of a rollcall page and checking the chart's
bounding box against the vote list's at every 100px of scroll: no
overlap at any sampled position after the fix (previously overlapped
at 375/768/900px), desktop sticky behavior at >=992px is unchanged,
and a resize across the breakpoint mid-scroll correctly attaches/
detaches with no console or page errors.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013KJMYfgTNsxrmjHZpZKAHT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant